home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
HAM Radio 1997
/
HAM Radio 1997.iso
/
vcls
/
prtgrid2
/
udemo.pas
< prev
Wrap
Pascal/Delphi Source File
|
1996-04-08
|
2KB
|
108 lines
unit Udemo;
interface
uses
SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
Forms, Dialogs, PrtGrid, DBTables, DB, Grids, DBGrids, StdCtrls,
ExtCtrls
;
type
TForm1 = class(TForm)
Table1: TTable;
DataSource1: TDataSource;
DBGrid1: TDBGrid;
Button1: TButton;
Button2: TButton;
Button3: TButton;
RadioGroup1: TRadioGroup;
PrintGrid1: TPrintGrid;
procedure Button1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
procedure RadioGroup1Click(Sender: TObject);
procedure FormDestroy(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
{ PrintGrid1: TPrintGrid;}{used for testing}
implementation
{$R *.DFM}
uses Printers;
procedure TForm1.Button1Click(Sender: TObject);
begin
PrintGrid1.Print;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
{ PrintGrid1 := TPrintGrid.Create(Self);}
with PrintGrid1 do
begin
{ DBGrid := DBGrid1;}
PrintMgrTitle := 'Report';
PrintFileName := 'out.txt';
DateLabel := '07/08/95';
Header := 'Report';
PageNumberPos := pnBotCenter;
DatePos := pnBotRight;
{ RowLines := true;
{ BottomMargin := 100;}
{ VerticalGapPct := 30;}
{ HeaderInTitle := true;}
{ Border := false;
ColLines := false;}
end;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
PrintGrid1.PrintDialog;
end;
procedure TForm1.Button3Click(Sender: TObject);
begin
with PrintGrid1 do
begin
PrintToFile := True;
Print;
PrintToFile := False;
end;
end;
procedure TForm1.RadioGroup1Click(Sender: TObject);
begin
if RadioGroup1.ItemIndex=0 then
Printer.Orientation := poPortrait
else
Printer.Orientation := poLandscape;
end;
procedure TForm1.FormDestroy(Sender: TObject);
begin
{ PrintGrid1.DBGrid := nil;
PrintGrid1.Free;}
end;
end.